<template>
  <div id="book_obj" :title="bookObj.info" @click="showDetails">
    <img :src="bookObj.cover"/>
    <div class="book_name">《{{bookObj.name}}》</div>
    <div class="book_author">作者:{{bookObj.author}}</div>
    <div class="book_price">￥{{bookObj.price.toFixed(2)}}</div>
    <div class="book_publish">出版社:{{bookObj.press}}</div>
  </div>
</template>

<script>

export default {
  name: "BookObj",
  props:{
    bookObj:{
      type:Object
    }
  },
  created() {

  },
  data(){
    return{
      dialogFormVisible:false,
    }
  },
  methods:{
    showDetails(){
      this.$router.push(`/bookdetails/${this.bookObj.isbn}`)
    }
  }
}
</script>

<style scoped>
#book_obj{
  width: 200px;
  /*background: pink;*/
  margin: 20px 9px;
  overflow: hidden;
  border: 2px solid #f2f2f2;
  border-radius: 10px;
  transition: all 300ms;
  cursor: pointer;
}
#book_obj:hover{
  background: #eeeeee;
}
#book_obj img{
  width: 100%;
  height: 200px;
  transition: all 300ms;
}
#book_obj img:hover{
  transform: scale(1.07);
}
#book_obj div{
  padding: 3px;
}
.book_name{
  width: 100%;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#book_obj:hover .book_name{
  text-decoration: underline;
  color: orangered;
}
.book_publish{
  color: #8c939d;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book_author{
  color: #8c939d;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.book_price{
  color: #C10D0C;
}
</style>
